<?php

/* All form fields are automatically passed to the PHP script through the array $HTTP_POST_VARS. */
$email = "info@webdesigner.com.sg";
$subject = "You have a contact from webdesigner.com.sg";
$name= $_POST["name"];
$mail= $_POST["mail"];
$phone= $_POST["phone"];
$message= $_POST["message"];
$from = "From: ".$mail;

	
$message = "Name: ".$name."\nEmail Address: ".$mail."\nContact Number: ".$phone."\nMessage: \n".$message;


	if(mail($email,$subject,$message,$from)){
	?>
		<script>
			setTimeout(function(){window.location = "../thank-you.html";},0);
		</script>
	<?php
	} else{
	?>
		<script>
			setTimeout(function(){window.location = "../contact-us.html";},3000);
		</script>
		<span class="cf4 fs22 pb20">Please, wait a minute and fill the form again!</span><br /><br />
	<?php
	}?>